import React from "react";
import { Routes, Route } from "react-router-dom";

import Main from "./components/Main";
import About from "./components/Main/about/index.jsx";
import Home from "./components/Main/home/index.jsx";

export default function App() {
  return (
    <div>
      <Routes>
        {/* 包裹路由的外层一定是双标签,例如二级路由是在一级路由里面,被一级路由包裹住的.*/}
        <Route path="/main" element={<Main />}>

          <Route path="/main/home" element={<Home />} />

          <Route path="/main/about" element={<About />} />
          <Route path="*" element={<Main/>}/>
        </Route>
      </Routes>
    </div>
  );
}
